<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      p {
        height: 400px;
        font-size: 3rem;
        border: solid;
      }
    </style>
  </head>
  <body>
    <a href="" id="link">link</a>
    <script>
      const link = document.getElementById("link");
      link.addEventListener("click", (e) => {
        if (e.defaultPrevented === false) {
          e.preventDefault();
        }
        console.log(1);
      });
      link.addEventListener("click", (e) => {
        if (e.defaultPrevented === false) {
          e.preventDefault();
        }
        console.log(2);
      });
      link.addEventListener("click", (e) => {
        if (e.defaultPrevented === false) {
          e.preventDefault();
        }
        console.log(3);
      });
    </script>
  </body>
</html>
